<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class FileDetailBase extends MiniyunViewForm
{
    public $id;

    public $userID;
    public $type;
    public $versionID;
    public $userNick;
    public $createdAt;

    public $curVersion;
    public $path;
    public $fileName;
    public function attributeLabels()
    {
        return array(
        	'versionID'  => '版本号',
            'type'       => '事件',
            'userNick'   => '创建者',
            'createdAt'  => '创建时间',
        );
    }

    public function doAction()
    {

        if ($this->versionID === $this->curVersion)
        {
            return CHtml::hiddenField("FileDetailForm[version]", $this->versionID).
            CHtml::submitButton("下载",array("class"=>"button-secondary action","name"=>"downloadAction")).
            CHtml::submitButton('当前版本', array("class"=>"button-secondary action", 'disabled'=>'disabled'));
        }
        return CHtml::hiddenField("FileDetailForm[version]", $this->versionID).
        CHtml::submitButton("下载",array("class"=>"button-secondary action","name"=>"downloadAction")).
        CHtml::submitButton("还原",array("class"=>"button-secondary action","name"=>"versionAction"));
    }
}
